<?php
if(isset($_SESSION['id'])) {
  $id = $_SESSION['id'];
} else {
  $id = isset($_GET['id'])?  $_GET['id'] : 0;
}
$selectQuery = "SELECT * FROM `users` WHERE `id`='$id'";
$result = mysql_query($selectQuery)or die(mysql_error());
$ans = mysql_fetch_assoc($result);
$gender = ($ans['gender'] == 0)?'Male':'Female';
?>
  <center><h3>My Profile</h3></center>
    <table border="0" width="100%" align="center"
    cellspacing="0">
      <thead>
        <tr>
          <th colspan="2">Your details are...(<a href="layout.php?page=edit_user&id=<?=$id?>"]>Edit</a>)</th>
        </tr>
      </thead>

      <tbody>

        <tr>
          <td align="right" width="40%">Name :</td>
          <td><?=$ans['name']?></td>
        </tr>

        <tr>
          <td align="right">Email :</td>
          <td><?=$ans['email']?></td>
        </tr>

        <tr>
          <td align="right">Gender :</td>
          <td><?=$gender?></td>
        </tr>

        <tr>
          <td align="right">Phone :</td>
          <td><?=$ans['phone']?>
        </tr>

        <tr>
          <td align="right">Date Of birth :</td>
          <td><?=$ans['dob']?></td>
        </tr>

        <tr>
          <td align="right">Address :</td>
          <td><?=$ans['address']?></td>
        </tr>

        <tr>
          <td align="right">Country :</td>
          <td><?=$ans['country']?></td>
        </tr>

        <tr>
          <td align="right">Prog Language :</td>
          <td><?=$ans['lang']?>
          </td>
        </tr>

        <tr>
          <td align="right">Hobbies :</td>
          <td><?=$ans['hobbies']?>
          </td>
        </tr>

        <tr>
          <td align="right">Image :</td>
          <td><img height="90" width="120" src="uploads/<?=$ans['image']?>" ></td>
        </tr>
      </thead>
    </table>
